package vip.meeet.thread.lock;

public class WaitStartA {

//    public void testWait(){
    public synchronized void testWait(){
        System.out.println("Start-----");
        try {
            wait(1000);//wait\notify都必须先拿锁
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("End-------");
    }

    public static void main(String[] args) {
        final WaitStartA test = new WaitStartA();
        new Thread(new Runnable() {
            @Override
            public void run() {
                test.testWait();
            }
        }).start();
    }
}
